<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>用户登录</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../assets/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../assets/style/login.css" media="all">
    <link rel="stylesheet" href="../assets/style/admin.css">
    <script src="../assets/layui/layui.js"></script>
    <script src="http://www.qqaaa.cn/common.js"></script>
</head>
<body layadmin-themealias="default" class="layui-layout-body">
<div id="LAY_app" class="layadmin-tabspage-none">
    <div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;">
        <div class="layadmin-user-login-main">
            <div class="layadmin-user-login-box layadmin-user-login-header">
                <h2>用户登录</h2>
            </div>
            <form class="layui-form" action="">
                <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
                    <div class="layui-form-item">
                        <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="username"></label>
                        <input type="text" name="username" id="username" lay-verify="username" placeholder="用户名" class="layui-input">
                    </div>
                    <div class="layui-form-item">
                        <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="password"></label>
                        <input type="password" name="password" id="password" lay-verify="password" placeholder="密码" class="layui-input">
                    </div>
                    <div class="layui-form-item">
                        <button class="layui-btn layui-btn-fluid" onclick="doLogin()">登 入</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script>
    layui.use('form', function () {
        var $ = layui.$, form = layui.form;

        form.render();

        // 默认聚焦
        $('#username').focus();
    });

    function doLogin() {
        callServer.login(ele('username').value, ele('password').value, '', function (back) {
            if (back.code === 2) {
                //登入成功的提示与跳转
                promptMsg(back.msg);
            } else {
                promptMsg(back.why);
            }
        });
    }
</script>
</body>
</html>
